package com.coolgor.coldot.enums.auth;

public enum OperationTraceStateEnum {
	SUCCESS(1000, "操作成功"), 
	INNER_ERROR(-1000, "内部错误"), 
	DENIAL(-1001, "限制操作"), 
	UNKNOWNERRER(-9999, "未知错误");

	private int state;

	private String stateInfo;

	private OperationTraceStateEnum(int state, String stateInfo) {
		this.state = state;
		this.stateInfo = stateInfo;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public static OperationTraceStateEnum stateOf(int index) {
		for (OperationTraceStateEnum state : values()) {
			if (state.getState() == index) {
				return state;
			}
		}
		return null;
	}
}
